﻿function showmessage(message, header, url, redirect) {
    var a = $(".showmessage");
    var content = message;
    //	if(a.hasClass("hasheader")){
    var head = header;
    $.jGrowl(content, { header: head });
    //	} else {
    //		$.jGrowl(content);
    //	}
    if (redirect == 'true') {
        setTimeout("window.location.href='" + url + "'", 3000);
    }
}

function showmessage1(message, header) {
    var a = $(".showmessage1");
    //var content = a.attr('title');
    var content = message;
    if (a.hasClass("hasheader")) {
        //var head = a.data('header');
        var head = header;
        $.jGrowl(content, { header: head });
    } else {
        $.jGrowl(content);
    }

}
function changetab() {
    var $tabs = $('#table_wTabs').tabs();
    $tabs.tabs('select', 2);
}
//function ShowPopup(){
////    alert('aaaaaaaaaaaaaaaa');
////    $.fx.speeds._default = 400; // Adjust the dialog animation speed
//	$(".bDialog").dialog({
//		autoOpen: false,
//		show: "fadeIn",
//		modal: true,
//		width:800,
//		buttons: {
//			"Select": function() {
//				$( this ).dialog( "close" );
//			},
//			"Close": function() {
//				$( this ).dialog( "close" );
//			}
//		}
//	});
//	$(".bDialog").parent().appendTo($("form:first"));
//	return false;
function OpenTab() {
    $("#table_wTabs").tabs().dialog("open");
}
function ClosePopup() {
    $('.DialogListOfBusiness').dialog("close");
}
function CloseContactPopup() {
    $('.DialogListContact').dialog("close");
}
function ClosePostcodePopup() {
    $('.DialogListOfPostCode').dialog("close");
}
function CloseAddressPopup() {
    $('.DialogAddress').dialog("close");
}
function ClosePremisePopup(){
    $('.DialogListOfPremise').dialog("close");
}
function OpenPopup(){
	$(".DialogListOfPremise").dialog( "open" );
	return false;
}
function CloseRolePopup() {
    $('.DialogListRole').dialog("close");
}

function OpenRolePopup() {
    $(".DialogListRole").dialog("open");
    return false;
}

function doSprin(){
    $(".spinner1").spinner();
    $(".spinner2").spinner({
        min: 0,
        max: 30
    });
    $(".pick_date").datepicker();
    $(".btTopF").tipsy({gravity: 's',fade: true});
}
function doTab(){
    var $tabs = $('#table_wTabs').tabs(); // first tab selected
    $('.changeTab').change(function() {
        var selectedVal = $('.changeTab option:selected').attr('value');
        if(selectedVal == 2){
            $tabs.tabs('select', 3); // switch to third tab
        }
        else {
            $tabs.tabs('select', 4);
        }
        return false;
    });
}